import * as THREE from 'three';

class settings{
  constructor(settings) {
    this.modelUrl = settings.modelUrl;
    this.debug = settings.debug?settings.debug : false;
    this.isLoadModel = !settings.isLoadModel? false : true;
    this.modelScale = settings.modelScale? settings.modelScale : 1;
    // 背景设置
    this.bgColor = settings.bgColor? settings.bgColor : '#ffffff'
    // 相机设置  初始化位置  飞行后的位置 
    // near fear距离
    this.isPlay = settings.isPlay? settings.isPlay : true;
    this.camera_fly_initpos = settings.camera_fly_initpos? settings.camera_fly_initpos : { x:0,y:1.5,z:1.5 };
    this.camera_initpos = settings.camera_initpos? settings.camera_initpos : { x:1,y:1,z:1 };
    this.camera_pos = settings.camera_pos? settings.camera_pos:{ x:0,y:2,z:0 };
    this.camera_near= settings.camera_near? settings.camera_near:0.1;
    this.camera_far = settings.camera_far? settings.camera_far:300;
    this.camera_fov = settings.camera_fov? settings.camera_fov:60;

    this.look_time = settings.look_time? settings.look_time : 1;
    this.camera_look_dir = settings.camera_look_dir? settings.camera_look_dir : new THREE.Vector3(0,0.7,1);// 相机相对look点方向
    this.camera_look_dis = settings.camera_look_dis? settings.camera_look_dis : 20 ;// 相机相对look点距离
    // 入场动画时间，单位毫秒
    this.camera_iniflytime = settings.camera_iniflytime? settings.camera_iniflytime : 1000;
    // hdr环境光设置
    this.hdrURl = settings.hdrURl;
    this.hdr_rotation = settings.hdr_rotation? settings.hdr_rotation:{x:0,y:0,z:0};
        
    // render设置
    this.exposure = settings.exposure? settings.Exposure : 0.7;

    // control设置
    this.control_target = settings.control_target? settings.control_target : { x:0,y:1,z:0 };
    this.control_autoRotate = settings.control_autoRotate? settings.control_autoRotate : false;
    this.control_autoSpeed = settings.control_autoSpeed? settings.control_autoSpeed:1;
    this.control_minDistance = settings.control_minDistance? settings.control_minDistance:1;
    this.control_maxDistance = settings.control_maxDistance? settings.control_maxDistance:111110;
    // 是否开启右键 拖拽场景视角
    this.control_pan = settings.control_pan? settings.control_pan:false;

    // 背景设置
    this.bgisShow = settings.bgisShow? settings.bgisShow : true;
    this.bgSize = settings.bgSize? settings.bgSize : 100;
    // 密度设置
    this.reapeat = settings.reapeat? settings.reapeat : 6;
    this.bgColor = settings.bgColor? settings.bgColor : 'rgb(53,104,204)';
    this.baseColor = settings.bgColor? settings.bgColor : 'rgb(53,104,204)';
    this.flowColor = settings.bgColor? settings.bgColor : 'rgba(65,208,255,1)';
    // 发光强度
    this.glowFactor = settings.glowFactor? settings.glowFactor : 10;

    this.ray_meshs = [];


    // 动作
    this.animations =settings.animations? settings.animations : []; //动画资源必须是fbx格式
  }
}

export default settings